﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace FCTC_Web.Models
{

    public class Vehicle : EntityBase
    {
        public int? ShopID { get; set; }
        public virtual Shop Shop { get; set; }

        public int? EstimatorID { get; set; }
        public virtual Estimator Estimator { get; set; }

        //申请人
        public int? PersonalID { get; set; }
        public Personal Personal { get; set; }

        [Display(Name = "车辆编号")]
        [MaxLength(20)]
        public string VehicleIdentity { get; set; }

        [Display(Name = "显示名称")]
        [MaxLength(50),Required(ErrorMessage = "请填写车子名称信息")]
        public string FullName { get; set; }

        [Display(Name = "所在地区")]
        [MaxLength(50)]
        public string Location { get; set; }

        [Display(Name="燃油类型")]
        [MaxLength(10)]
        public string Fuel { get; set; }

        [Display(Name = "原先用途")]
        [MaxLength(10)]
        public string Usage { get; set; }

        [Display(Name = "录入时间")]
        [DisplayFormat(DataFormatString = "{0:d}", ApplyFormatInEditMode = true)]
        public DateTime? EnrollmentDate { get; set; }

        [Display(Name = "年份")]
        [Range(1900,9999)]
        public int? Year { get; set; }
        //StringResources
        [Display(Name = "手/自动档")]
        public string Gears { get; set; }

        [Display(Name = "是否有天窗")]
        public bool HasAPS { get; set; }

        [Display(Name = "是否有雷达")]
        public bool HasRadar { get; set; }

        [Display(Name="是否有导航")]
        public bool HasGPS { get; set; }

        [Display(Name = "是否有真皮座椅")]
        public bool HasSeat { get; set; }

        [Display(Name = "品牌"), Required(ErrorMessage = "请选择车子的品牌")]
        [MaxLength(20)]
        public string CarBrand { get; set; }

        [Display(Name = "型号"), Required(ErrorMessage = "请选择车子的型号")]
        [MaxLength(50)]
        public string BrandType { get; set; }

        [Display(Name = "配置"), Required(ErrorMessage = "请选择车子的配置")]
        [MaxLength(50)]
        public string VehicleStyle { get; set; }

        [Display(Name = "行驶里程(万公里)")]
        [Range(0,int.MaxValue,ErrorMessage="行程不能为负数或过大")]
        public Double? Miles { get; set; }

        [Display(Name = "车龄")]
        [Range(0, 50, ErrorMessage = "车龄范围在 0 到 50年之间.")]
        public int? VehicleAge { get; set; }

        [Display(Name = "转向")]
        [MaxLength(20)]
        public string SteeringGear { get; set; }

        [Display(Name = "保险到期")]
        public bool AssuranceExpxired { get; set; }

        [Display(Name = "检车到期")]
        public bool CheckExpxired { get; set; }

        [Column(TypeName = "money")]
        [Display(Name = "价格(万)")]
        [Range(0, int.MaxValue)]
        public decimal? Prize { get; set; }

        [Column(TypeName = "money")]
        [Display(Name = "新车价格(万)")]
        [Range(0, int.MaxValue)]
        public decimal? OriginalPrize { get; set; }

        [Display(Name = "排量")]
        [MaxLength(10),Required(ErrorMessage="请选择车子的排量")]
        public string DeliveryCapacity { get; set; }

        [Display(Name = "防抱死系统")]
        public bool ABS { get; set; }

        [Display(Name = "电子制动力分配")]
        public bool EBD { get; set; }

        [Display(Name = "牵引力控制系统")]
        public bool TCS { get; set; }

        [Display(Name = "车身电子稳定系统")]
        public bool ESP { get; set; }
        //颜色
        [Display(Name = "颜色")]
        [MaxLength(20)]
        public string Color { get; set; }

        [Display(Name = "车辆状态")]
        [MaxLength(20)]
        public string VehicleStatus { get; set; }

        [Display(Name = "车辆种类")]//轿车  客车  越野车  商务车 
        [MaxLength(20)]
        public string Category{ get; set; }

        [Display(Name = "特价车")]
        public bool SpecialOffer { get; set; }

        // 对应图片地址列表
        public virtual List<ImageModel> Imgs { get; set; }



    }
}